<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddReportValueToOpenShopLocationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_location', function (Blueprint $table) {
            $table->string('shopAddressPrefix', 120)->default('')->comment('门店所在区域前缀');
            $table->string('provinceCode', 12)->default('')->comment('省份code');
            $table->string('cityCode', 12)->default('')->comment('市级code');
            $table->string('districtCode', 12)->default('')->comment('区域code');
            $table->string('shopDetailAddress', 255)->default('')->comment('门店所在区域详细地址');
            $table->unsignedInteger('shopRent')->default(0)->comment('门店租金 分');
            $table->unsignedInteger('shopArea')->default(0)->comment('门店面积 m²');
            $table->string('shopType', 20)->default('')->comment('店型');
            $table->string('shopScopeProducts', 200)->default('')->comment('产品限制销售范围');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_location', function (Blueprint $table) {
            $table->dropColumn('shopAddressPrefix');
            $table->dropColumn('provinceCode');
            $table->dropColumn('cityCode');
            $table->dropColumn('districtCode');
            $table->dropColumn('shopDetailAddress');
            $table->dropColumn('shopRent');
            $table->dropColumn('shopArea');
            $table->dropColumn('shopType');
            $table->dropColumn('shopScopeProducts');
        });
    }
}
